import request from '@/utils/request'
import * as URL from '@/constants/api'

export function login(data) {
  return request({
    url: URL.LOGIN,
    method: 'post',
    data
  })
    .then(res => {
    // 记录token
      localStorage.setItem('token', res.data.data)
      return res.data
    })
}

export function getProfile() {
  return request({
    url: URL.PROFILE,
    method: 'post'
  })
    .then(res => res.data.data)
}
